local function main (userOb, msgData)
    if not msgData.key then
        return
    end

    if type(msgData.key) ~= "string" or #msgData.key > 255 then
        local result = {}
        result.error = 1
        result.key = msgData.key
        userOb:send_packet("MSGS2CQuery", result)
        return
    end

    local context = userOb:query("client_dbase", msgData.key) or ""

    local result = {}
    result.error = 0
    result.key = msgData.key
    result.context = context
    userOb:send_packet("MSGS2CQuery", result)
end

COMMAND_D:register_command("MSGC2SQuery", GameCmdType.NONE, main)
